package com.gan.ganapiinterface.controlelr;

import com.gan.ganapiclient.model.User;
import com.gan.ganapiclient.utils.SignUtil;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * 名称api
 *
 * @author gan
 * @date 2023/5/5 10:49
 */
@RestController()
@RequestMapping("/name")
public class NameController {

    @GetMapping("")
    public String getNameByGet(String name) {
        return "get 你的名字是" + name;
    }

    @PostMapping("/post")
    public String getNameByPost(@RequestParam String name) {
        return "post 你的名字是" + name;
    }

    @PostMapping("/user")
    public String getUserNameByPost(@RequestBody User user, HttpServletRequest request) {

        String result = "post 你的用户名是" + user.getUserName();

        return result;
    }

}
